// "url": "http://plm.muxin.com:80/Windchill/servlet/rest/hzero/pmgt/taskbook/showTaskBookInfoTable",
import { request } from "@/utils/request";
let userinfo = JSON.parse(sessionStorage.getItem('userInfo'))
let userId = ''
let organizationId = 0;
if (userinfo) {
    organizationId = userinfo.tenantId
    userId = userinfo.loginName
}
//  获取项目对象的属性布局
export function getPanleForPipmgt(parameter) {
    return request({
      url: '/project/Windchill/servlet/rest/hzero/pdm/attribute/getPanleForPipmgt',
      method: 'post',
      data: parameter
    })
}
//  获取获取仿真分析项列表
export function getAnalysisItems(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/getAnalysisItems',
    method: 'post',
    data: parameter
  })
}
//  导出仿真委托书列表 
export function exportTableData(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/project/exportTableData',
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
// 删除委托书记录
export function deleteObjForAllVersion(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pdm/core/deleteObjForAllVersion',
    method: 'post',
    data: parameter,
  })
}
//  获取委托书的基本信息属性
export function entrustBookBaseAttr(parameter) {
    return request({
      url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/entrustBookBaseAttr',
      method: 'post',
      data: parameter
    })
}
// 获取流程处理的选择框属性
export function getPageSelectPrincipal(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getPageSelectPrincipal',
    method: 'post',
    data: parameter,
  })
}
// 获取已选的流程审批人
export function getWFSelectPrincipal(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getWFSelectPrincipal',
    method: 'post',
    data: parameter,
  })
}
// 更新流程处理人
export function updateTeamPrincipal(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/pmgt/workflow/updateTeamPrincipal',
    method: 'post',
    data: parameter,
  })
}
// 创建仿真分析项
export function createAnalysisItems(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/createAnalysisItems',
    method: 'post',
    data: parameter,
  })
}
// 下载数据准备单
export function downTeamTemplate(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/downTeamTemplate',
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
// 下载历史数据准备单
export function getPreparationFile(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/getPreparationFile',
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
// 关联图纸查询
export function searchCADs(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/searchCADs',
    method: 'post',
    data: parameter,
  })
}
// 获取编辑委托书关联的图纸
export function getRelatedCad(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/getRelatedCad',
    method: 'post',
    data: parameter,
  })
}
// 获取委托书关联的仿真报告
export function getRelatedDoc(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/getRelatedDoc',
    method: 'post',
    data: parameter,
  })
}
// 创建仿真委托书
export function createEntrustBook(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/createEntrustBook',
    method: 'post',
    data: parameter,
  })
}
// 获取仿真委托书列表
export function getEntrustBooks(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/getEntrustBooks',
    method: 'post',
    data: parameter,
  })
}
// 仿真委托书拆分
export function splitEntrustBook(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/splitEntrustBook',
    method: 'post',
    data: parameter,
  })
}
// 获取仿真委托书历史版本
export function getVersionHistory(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pdm/core/getVersionHistory',
    method: 'post',
    data: parameter,
  })
}
// 获取交付物流程节点（流程指引）
export function getProcessSteps(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getProcessSteps',
    method: 'post',
    data: parameter,
  })
}
// 获取流程操作
export function getRouting(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getRouting',
    method: 'post',
    data: parameter,
  })
}
// 获取交付物流程处理表格数据
export function getDisposeStatus(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/getDisposeStatus',
    method: 'post',
    data: parameter,
  })
}
// 获取交付物流程处理表格数据
export function canStartEntrustBookWorkflow(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/canStartEntrustBookWorkflow',
    method: 'post',
    data: parameter,
  })
}
/**开启流程 */
export function startWfProcess(parameter) {
  return request({
    url: `/project/Windchill/servlet/rest/hzero/pmgt/sdm/startWfProcess`,
    method: 'post',
    data: parameter,
  })
}
// 删除仿真分析项
export function deleteAnalysisItems(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/deleteAnalysisItems',
    method: 'post',
    data: parameter,
  })
}
// 删除仿真分析项
export function updateEntrustBookCad(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/updateEntrustBookCad',
    method: 'post',
    data: parameter,
  })
}
// 流程操作提交
export function completeWorkItem(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/completeWorkItem',
    method: 'post',
    data: parameter,
  })
}
// 流程操作提交--转办
export function reassignWorkItem(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/foundation/workflow/reassignWorkItem',
    method: 'post',
    data: parameter,
  })
}
// 流程随签的仿真委托书
export function reviewObjectBooks(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/reviewObjectBooks',
    method: 'post',
    data: parameter,
  })
}
// 启动委托书废弃流程
export function entrustBookAbandonWf(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/entrustBookAbandonWf',
    method: 'post',
    data: parameter,
  })
}
// 能否启动委托书废弃流程
export function canStartEntrustAbandon(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/canStartEntrustAbandon',
    method: 'post',
    data: parameter,
  })
}
// 添加随签的委托书
export function addDocProcessReviewObj(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/pmgt/workflow/addDocProcessReviewObj',
    method: 'post',
    data: parameter,
  })
}
// 删除随签的委托书
export function removeDocProcessReviewObj(parameter) {
  return request({
    url: '/workflow/Windchill/servlet/rest/hzero/pmgt/workflow/removeDocProcessReviewObj',
    method: 'post',
    data: parameter,
  })
}
// 更新流程中随签的委托书版本
export function updateEntrustBookForReview(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/updateEntrustBookForReview',
    method: 'post',
    data: parameter,
  })
}
// 判断仿真分析项类型
export function createAnalysisItemPanle(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/createAnalysisItemPanle',
    method: 'post',
    data: parameter,
  })
}
// 下载文档
export function downloadDoc(parameter) {
  return request({
    url: '/deliver/Windchill/servlet/rest/hzero/foundation/doc/downloadDoc',
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
// 获取文档类型
export function getPrimaryFileType(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pdm/core/getPrimaryFileType',
    method: 'post',
    data: parameter,
  })
}
// 获取问题附件信息
export function simulationAttachmentInfo(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pdm/core/getAttachmentInfo',
    method: 'post',
    data: parameter
  })
}
// 下载附件
export function downloadAttachmentFile(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pdm/core/downloadAttachmentFile',
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}